﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;

namespace Three_Red_Dragon_Mvc.Controllers
{
    /// <summary>
    ///销售 订单
    /// </summary>
    public class SaleController : Controller
    {
        private readonly IpAddressesConfig _ipAddressesConfig;
        public SaleController(IOptions<IpAddressesConfig> ipAddressesConfig)
        {
            _ipAddressesConfig = ipAddressesConfig.Value;
        }
        public IActionResult Index()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }
        /// <summary>
        /// 销售添加
        /// </summary>
        /// <returns></returns>
        public IActionResult AddSale()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }
        /// <summary>
        /// 销售显示
        /// </summary>
        /// <returns></returns>
        public IActionResult ShowSale()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }

        /// <summary>
        /// 销售修改
        /// </summary>
        /// <returns></returns>
        public IActionResult UpdateSale()
        {
            ViewBag.RBACWrite = _ipAddressesConfig.RBACWrite;
            ViewBag.RedDragonWrite = _ipAddressesConfig.RedDragonWrite;
            return View();
        }
    }
}
